The QuickTime VR Manager provides functions that you can use to access the two internal buffers used by QuickTime VR when it's imaging a panorama.
You can use the QTVRSetPrescreenImagingCompleteProc function to install or remove a prescreen buffer imaging completion procedure.
OSErr QTVRSetPrescreenImagingCompleteProc (
QTVRInstanceqtvr,
ImagingCompleteUPPimagingCompleteProc,
SInt32refCon,
UInt32 flags);
The QTVRSetPrescreenImagingCompleteProc function installs the procedure specified by the imagingCompleteProc parameter as a prescreen buffer imaging completion procedure for the QuickTime VR movie specified by the qtvr parameter. Your procedure is called whenever QuickTime VR finishes drawing an image into the prescreen buffer. The reference constant specified by the refCon parameter is passed unchanged to that prescreen buffer imaging completion procedure.
To remove a previously installed prescreen buffer imaging completion procedure, set imagingCompleteProc to nil .
You can use the QTVRSetBackBufferImagingProc function to install or remove a back buffer imaging procedure.
OSErr QTVRSetBackBufferImagingProc (
QTVRInstance qtvr,
BackBufferImagingUPP backBufferImagingProc,
UInt16 numAreas,
AreaOfInterest *areasOfInterest,
SInt32 refCon);
The QTVRSetBackBufferImagingProc function installs the procedure specified by the backBufferImagingProc parameter as a back buffer imaging procedure for the panoramic node specified by the qtvr parameter. You can use that procedure to draw directly into the back buffer.
The areasOfInterest parameter is a pointer to an array of area of interest structures that define the rectangular areas about which you want your back buffer imaging procedure to be notified. Your procedure is called for each area of interest as it becomes visible or not visible. You indicate when you want your procedure to be called for a particular area of interest by setting flags in the flags field in the corresponding area of interest structure.
The QuickTime VR Manager version 2.1 supports only one area of interest in this array. Future versions will support multiple areas of interest.
Note that coordinates in the back buffer are dependent on the current correction mode; as a result, you need to indicate the area you're interested in drawing into by specifying a pan angle and tilt angle to determine the upper-left corner of the area and a height and width relative to that corner. (Specifying a height and width instead of a second pair of pan and tilt angles for the bottom-right coordinate allows the rectangle to wrap around the edge of the panorama.)
The width of the area of interest is limited by the size of the back buffer. If the back buffer is less than the full cache size, then the area of interest can be no wider than half the size of the back buffer. (For vertical cylinder geometries, limiting factor would be the height of the buffer.) For a full cache back buffer, the width of the area of interest can be the full size of the buffer. If the width limit is exceeded, QTVRSetBackBufferImagingProc will return constraintReachedErr .
To remove a previously installed back buffer imaging procedure, set backBufferImagingProc to nil .
Use QTVRSetPrescreenImagingCompleteProc to install or remove a prescreen buffer imaging completion procedure.
You can use the QTVRRefreshBackBuffer function to refresh the back buffer.
OSErr QTVRRefreshBackBuffer (QTVRInstance qtvr, UInt32 flags);
The QTVRRefreshBackBuffer function refreshes some or all of the back buffer associated with the QuickTime VR movie specified by the qtvr parameter by reloading the appropriate data from the diced frames in the panorama image track.
You can call QTVRRefreshBackBuffer either in a back buffer imaging procedure or elsewhere in your application. If you call QTVRRefreshBackBuffer in a back buffer imaging procedure, only the current rectangle (that is, the rectangle specified by the procedure's drawRect parameter) is refreshed. If you call QTVRRefreshBackBuffer outside of a back buffer imaging procedure, all areas of interest specified in the most recent call to QTVRSetBackBufferImagingProc are refreshed.
See "MyBackBufferImagingProc" for information about back buffer imaging procedures.
| Previous | Chapter Contents | Chapter Top | Next |